<h2>Edit</h2>
<div id="add-control" style="">
    <h3><%= l(:repository_controls_new) %></h3>
    <% labelled_tabular_form_for :repository_control, @control, :url => { :action => 'edit', :id => @control} do |f| %>
        <% roles = Role.find_all_givable %>
        <div class="box tabular">
            <p><label for="role_id"><%= l(:label_role) %></label>
                <%= f.select :role_id, roles.collect{|role| [role.name, role.id]} %></p>
            
            <p><%= f.text_field :path, :label => "Path", :size => 60, :required => true %></p>
            <p><label for="repository_control[permissions][]">
                <%= l_or_humanize("browse_repository", :prefix => 'permission_') %></label>
            <%= check_box_tag 'repository_control[permissions][]', "browse_repository", (@control.permissions.include? :browse_repository)%>
            </p>
            <p><label for="repository_control[permissions][]">
                <%= l_or_humanize("commit_access", :prefix => 'permission_') %></label>
            <%= check_box_tag 'repository_control[permissions][]', "commit_access", (@control.permissions.include? :commit_access) %>
            </p>
        </div>
        <%= submit_tag l(:button_edit) %> 
    <% end %>
</div>

